<?php
include("lib/lib_dps.php");
include("lib/template.inc");
include("nav_data.php");
$m=0;
if(isset($_POST["username"]) AND isset($_POST["password"]) AND isset($_POST["epsn"]))
{
	$rtn=ccr_user_login($_POST["username"],$_POST["password"],$_POST["epsn"]);
	switch($rtn)
	{
		case "0":
			$doc[$m]["title"]='登录失败';
			$doc[$m]["content"]='未知错误<br /><a href="javascript:window.history.go(-1);">点击这里</a>返回';
			$doc[$m]["wid"]='100%';
			$m++;
			break;
		case "1":
			$doc[$m]["title"]='登录失败';
			$doc[$m]["content"]='CCR未找到<br /><a href="javascript:window.history.go(-1);">点击这里</a>返回';
			$doc[$m]["wid"]='100%';
			$m++;
			break;
		case "2":
			$doc[$m]["title"]='登录失败';
			$doc[$m]["content"]='用户不存在<br /><a href="javascript:window.history.go(-1);">点击这里</a>返回';
			$doc[$m]["wid"]='100%';
			$m++;
			break;
		case "3":
			$doc[$m]["title"]='登录失败';
			$doc[$m]["content"]='密码错误<br /><a href="javascript:window.history.go(-1);">点击这里</a>返回';
			$doc[$m]["wid"]='100%';
			$m++;
			break;
		case "4":
			$doc[$m]["title"]='登录成功';
			$doc[$m]["content"]='欢迎您'.$_POST["username"].'！';
			$doc[$m]["wid"]='100%';
			$m++;
			break;
	}
}
include("render.php");
render("登录结果",$nav_title,$nav_link,$doc);
?>
